package cn.gson.boot.model.service;

import cn.gson.boot.model.dao.*;
import cn.gson.boot.model.mapper.*;
import cn.gson.boot.model.pojos.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class MainPageService {
    @Autowired
    MainPageMapper mainPageMapper;

    //查询员工七天内新增的客户
    public Integer selectEmpSevenDayKehu(String kcjTime,Integer empId){
        return mainPageMapper.selectEmpSevenDayKehu(kcjTime,empId);
    }
    //查询员工七天内新增的订单(统计)
    public Integer selectEmpSevenDayDingDan(String ddTime,String empName){
        return mainPageMapper.selectEmpSevenDayDingDan(ddTime,empName);
    }


    //查询七天内新增的合同(统计)
    public Integer selectSevenDayHeTong(@Param("htTime") String htTime){
        return mainPageMapper.selectSevenDayHeTong(htTime);
    }
    //查询七天内新增的订单(统计)
    public Integer selectSevenDayDingDan(@Param("ddTime") String ddTime){
        return mainPageMapper.selectSevenDayDingDan(ddTime);
    }
    //查询七天内新增的回款(统计)
    public Integer selectSevenDayHuiKuan(@Param("hkTime") String hkTime){
        return mainPageMapper.selectSevenDayHuiKuan(hkTime);
    }
    //查询七天内新增的退货(统计)
    public Integer selectSevenDayTuiHuo(@Param("thTime") String thTime){
        return mainPageMapper.selectSevenDayTuiHuo(thTime);
    }
    //查询七天内新增的换货(统计)
    public Integer selectSevenDayHuanHuo(@Param("hhTime") String hhTime){
        return mainPageMapper.selectSevenDayHuanHuo(hhTime);
    }


    //查询员工负责的首所有客户
    public Integer selectEmpKehu(String empName){
        return mainPageMapper.selectEmpKehu(empName);
    }
    //查询员工负责的所有合同
    public Integer selectEmpHetong(String empName){
        return mainPageMapper.selectEmpHetong(empName);
    }
    //查询员工负责的所有订单
    public Integer selectEmpDingDan(String empName){
        return mainPageMapper.selectEmpDingDan(empName);
    }


    //查询所有的员工的姓名
    public List<String> selectAllEmpNameQvChong(){
        return mainPageMapper.selectAllEmpNameQvChong();
    }
    public Integer selectPaiHang(String time,String empName){
        return mainPageMapper.selectPaiHang(time,empName);
    }


    //按时间查合同
    public Integer selectHeTongByTime(String time){
        return mainPageMapper.selectHeTongByTime(time);
    }
    //按时间查订单
    public Integer selectDingDanByTime(String time){
        return mainPageMapper.selectDingDanByTime(time);
    }
    //按时间查客户
    public Integer selectKeHuByTime(String time){
        return mainPageMapper.selectKeHuByTime(time);
    }
}
